package com.amigo.online.provider.manager.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.amigo.online.common.base.service.BaseService;
import com.amigo.online.provider.manager.mapper.FollowTblMapper;
import com.amigo.online.provider.manager.mapper.UserMapper;
import com.amigo.online.provider.manager.model.entity.FollowTbl;
import com.amigo.online.provider.manager.model.entity.User;
import com.amigo.online.provider.manager.service.FollowTblService;

@Service
public class FollowTblServiceImpl extends BaseService<FollowTbl> implements FollowTblService {

    @Resource
    private FollowTblMapper followTblMapper;

    @Resource
    private UserMapper userMapper;

    @Override
    public List<FollowTbl> findTargetUser(FollowTbl followTbl) {
        return followTblMapper.findTargetUser(followTbl);
    }

    @Override
    public List<FollowTbl> findFansUser(FollowTbl followTbl) {
        return followTblMapper.findFansUser(followTbl);
    }

    @Override
    public List<User> findFriendUser(FollowTbl followTbl) {
        List<FollowTbl> ff = followTblMapper.findFriendUserId(followTbl);
        List<User> userlist = userMapper.findFriendUser(ff);

        return userlist;

    }

}
